import * as types from './mutation_types'
import request from '../../../util/axios'

// 获取电子文件搜索条件
export const getSearchOptions = ({ commit }, tableId) => {
  commit(types.SEARCH_SET_RETRIEVED, null)
  return request({
    url: `/yuyi-category-boot/api/metadata/user/retrieval/${tableId}`,
    method: 'get',
    data: {}
  }).then((res) => {
    commit(types.SEARCH_SET_RETRIEVED, res.data.data)
    return res
  }).catch(e => {
    commit(types.SEARCH_SET_RETRIEVED, null)
    return e
  })
}
